/* 点击按钮，下拉菜单在 显示/隐藏 之间切换 */
function myFunction() {
    document.getElementById("myDropdown").classList.toggle("show");
}

// 点击下拉菜单意外区域隐藏
window.onclick = function(event) {
  if (!event.target.matches('.dropbtn')) {

    var dropdowns = document.getElementsByClassName("dropdown-content");
    var i;
    for (i = 0; i < dropdowns.length; i++) {
      var openDropdown = dropdowns[i];
      if (openDropdown.classList.contains('show')) {
        openDropdown.classList.remove('show');
      }
    }
  }
}
$(function(){
    $('.function>.function-left>.subnav>li').mouseover(function(){
        $(this).children('ul').show()
    })
    $('.function>.function-left>.subnav>li').mouseout(function(){
        $(this).children('ul').hide()
    })
})


var oLi = document.querySelectorAll(".content_body_left ul  span");
var aSpan = document.querySelectorAll(".content_body_left span");
var aUl = document.querySelectorAll(".content_body_left ul");
var aImg = document.querySelectorAll(".content_body_left_img2 ");

var oSearchInp4 = document.querySelector('.searchInp4');
// 循环span节点
for (var i = 0; i < aSpan.length; i++) {
  // 设置span的点击事件
  aSpan[i].onclick = function () {
    var oUl = this.nextElementSibling.nextElementSibling;
    if (getComputedStyle(oUl).height == "0px") {
      this.nextElementSibling.style.transform = "rotate(180deg)";
      oUl.style.height =
        oUl.children[0].offsetHeight * oUl.children.length + "px";
    } else {
      // 否则高度为0
      oUl.style.height = "0" + "px";
      this.nextElementSibling.style.transform = " rotate(90deg)";
    }
  };
}





function render() {
    
  //查看搜索框的内容 条件
  var str4= oSearchInp4.value==''?new Date('1992-8-25').getTime():new Date(oSearchInp4.value).getTime(); //开始时间
  var str5= oSearchInp5.value==''?new Date().getTime():new Date(oSearchInp4.value).getTime(); //结束时间
  var searchData=[]; //最终用来渲染的;
  var data1=[];
  var data2=[];
  var data3=[];
  
  if(str1.trim()==''){
      data1=data;
  }else{
      data1=data.filter(function(v){
          // if(v.name.includes(str1)){
          //     return v
          // }
          return v.name.includes(str1)
      })
  }

  if(str2.trim()==''){
      data2=data1;
  }else{
      data2=data1.filter(function(v){
         /*  if(v.user.includes(str2)){
              return v
          } */
          return v.user.includes(str2)
      })
  }

  if(str3.trim()==''){
      data3=data2;
  }else{
      data3=data2.filter(function(v){
          if(v.tel.includes(str3)){
              return v
          }
      })
  }

  searchData=data3.filter(function(v){
      var time=new Date(v.birthday).getTime();
      return time>=str4 && time<=str5
  })
}